﻿using System;
using System.Collections.Generic;

namespace KataPotter_V1
{
    public static class KataPotterSeriesBuilder
    {
        public static int[] BuildSeries(int[] Warenkorb)
        {
            var MostWantedBookRankDesc = GetMostWantedBookRank(Warenkorb);
        }

        public static int[] GetMostWantedBookRank(int[] Warenkorb)
        {
            var SortierterWarenkorb = Warenkorb;
            Array.Sort(SortierterWarenkorb);

            return ReverseMostWantedBookRank(SortierterWarenkorb);
        }

        public static int[] ReverseMostWantedBookRank(int[] MostWantedBookRankAsc)
        {
            List<int> MostWantedBookRankDesc = new List<int>();

            foreach (var Rank in MostWantedBookRankAsc)
            {
                MostWantedBookRankDesc.Insert(0, Rank);
            }

            return MostWantedBookRankDesc.ToArray();
        }
    }
}